package com.hanzidong.bean;

import java.io.Serializable;
import java.util.Date;

import com.hanzidong.utils.DateUtil;

/**
 * 文章表
 * @author 
 * @version 
 */
public class Article implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 7179961678406956379L;
	private Integer id;//
	private String title;// 标题
	private String content;// 文章内容
	private String picture;// 标题图片
	private Integer channelId;// 所属栏目
	private Integer categoryId;// 所属分类
	private Integer userId;// 文章发布人
	private Integer hits;// 点击量
	private Integer hot;// 是否热门
	private Integer status;// 0,刚发布,1审核通过,-1 审核未通过
	private Integer deleted;// 0:正常,1:删除
	private Date created;// 创建时间
	private Date updated;// 修改时间
	private String summary;// 摘要
	private Integer contentType;// 文章类型: 0:html 1:json
	private String keywords;// 关键字
	private String original;// 文章来源
	private Integer comments;// 评论数量
	
	private String channelName;//频道
	private String categoryName;//分类
	private String userName;//用户
	
	private String displayTime;//人性化时间
	
	
	
	public String getDisplayTime() {
		//计算人性化时间
		if(created != null) {
			displayTime = DateUtil.getDisplayTime(created);
		}
		
		return displayTime;
	}
	public void setDisplayTime(String displayTime) {
		this.displayTime = displayTime;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getPicture() {
		return picture;
	}
	public void setPicture(String picture) {
		this.picture = picture;
	}
	public Integer getChannelId() {
		return channelId;
	}
	public void setChannelId(Integer channelId) {
		this.channelId = channelId;
	}
	public Integer getCategoryId() {
		return categoryId;
	}
	public void setCategoryId(Integer categoryId) {
		this.categoryId = categoryId;
	}
	public Integer getUserId() {
		return userId;
	}
	public void setUserId(Integer userId) {
		this.userId = userId;
	}
	public Integer getHits() {
		return hits;
	}
	public void setHits(Integer hits) {
		this.hits = hits;
	}
	public Integer getHot() {
		return hot;
	}
	public void setHot(Integer hot) {
		this.hot = hot;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public Integer getDeleted() {
		return deleted;
	}
	public void setDeleted(Integer deleted) {
		this.deleted = deleted;
	}
	public Date getCreated() {
		return created;
	}
	public void setCreated(Date created) {
		this.created = created;
	}
	public Date getUpdated() {
		return updated;
	}
	public void setUpdated(Date updated) {
		this.updated = updated;
	}
	public String getSummary() {
		return summary;
	}
	public void setSummary(String summary) {
		this.summary = summary;
	}
	public Integer getContentType() {
		return contentType;
	}
	public void setContentType(Integer contentType) {
		this.contentType = contentType;
	}
	public String getKeywords() {
		return keywords;
	}
	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}
	public String getOriginal() {
		return original;
	}
	public void setOriginal(String original) {
		this.original = original;
	}
	public Integer getComments() {
		return comments;
	}
	public void setComments(Integer comments) {
		this.comments = comments;
	}
	public String getChannelName() {
		return channelName;
	}
	public void setChannelName(String channelName) {
		this.channelName = channelName;
	}
	public String getCategoryName() {
		return categoryName;
	}
	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public Article(Integer id, String title, String content, String picture, Integer channelId, Integer categoryId,
			Integer userId, Integer hits, Integer hot, Integer status, Integer deleted, Date created, Date updated,
			String summary, Integer contentType, String keywords, String original, Integer comments) {
		super();
		this.id = id;
		this.title = title;
		this.content = content;
		this.picture = picture;
		this.channelId = channelId;
		this.categoryId = categoryId;
		this.userId = userId;
		this.hits = hits;
		this.hot = hot;
		this.status = status;
		this.deleted = deleted;
		this.created = created;
		this.updated = updated;
		this.summary = summary;
		this.contentType = contentType;
		this.keywords = keywords;
		this.original = original;
		this.comments = comments;
	}
	public Article() {
		super();
	}
	@Override
	public String toString() {
		return "Article [id=" + id + ", title=" + title + ", content=" + content + ", picture=" + picture
				+ ", channelId=" + channelId + ", categoryId=" + categoryId + ", userId=" + userId + ", hits=" + hits
				+ ", hot=" + hot + ", status=" + status + ", deleted=" + deleted + ", created=" + created + ", updated="
				+ updated + ", summary=" + summary + ", contentType=" + contentType + ", keywords=" + keywords
				+ ", original=" + original + ", comments=" + comments + ", channelName=" + channelName
				+ ", categoryName=" + categoryName + ", userName=" + userName + "]";
	}
	
	
	
} 
